package com.reflex;

import com.reflex.controller.ReflexController;
import com.reflex.utils.MethodMapping;
import org.springframework.web.bind.annotation.*;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

@RestController
public class TestController {

    private static final ReflexController reflexController = new ReflexController();

    @RequestMapping(value = "/sendMessage", method = RequestMethod.GET)
    public void sendMessage(@RequestParam(value = "name") String name) throws Exception {
        Method targetMethod = MethodMapping.mappingTo("findName");
        System.out.println(targetMethod);
        targetMethod.invoke(reflexController, name);
    }
}
